import request from '@/utils/request'
// 获取图书列表
export const getTaskListAPI = params => {
  return request({
    url: '/data',
    method: 'GET',
    params
  })
}
// 新增任务
export const addTaskAPI = data => {
  return request({
    url: '/data',
    method: 'POST',
    data
  })
}
// 获取任务详情
export const editTaskDetailAPI = id => {
  return request({
    url: `/data/${id}`,
    method: 'GET'
  })
}
// 编辑任务
export const editTaskAPI = data => {
  return request({
    url: `/data/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除任务

export const delTaskAPI = id => {
  return request({
    url: `/data/${id}`,
    method: 'DELETE'
  })
}

// 搜索任务

export const searchTaskAPI = name => {
  return request({
    url: `/data/?name=${name}`,
    method: 'GET'
  })
}
